#include "zuoye.h"
int main(int argc, char const *argv[])
{
    node_t *phead = NULL;
    creat_node(&phead,-1);
    printf("phead = %p\n",phead);//打印phead的地址到终端上
    
    insert_list_by_head (phead,10);
    insert_list_by_head (phead,20);
    insert_list_by_head (phead,30);
    insert_list_by_head (phead,40);
    insert_list_by_head (phead,50);
    print_list(phead);//50 40 30 20 10

    insert_list_by_tail(phead,60);
    insert_list_by_tail(phead,70);
    insert_list_by_tail(phead,80);
    print_list(phead);//50 40 30 20 10 60 70 80

    insert_list_by_pos(phead,9,100);//报错
    insert_list_by_pos(phead,2,90);
    print_list(phead);//50 40 90 30 20 10 60 70 80

    delete_list_by_head(phead);
    delete_list_by_head(phead);
    delete_list_by_head(phead);
    print_list(phead);//30 20 10 60 70 80

    delete_list_by_tail(phead);
    delete_list_by_tail(phead);
    print_list(phead);//30 20 10 60

    delete_list_by_pos(phead,4);//报错
    delete_list_by_pos(phead,1);
    print_list(phead);//30 10 60






















    return 0;
}
